#include "TCPServer.h"

void TCPServer_Init(TCPServer *t, const char *name, const char *address, int port)
{
    printf("[%s:%d] Init for TCPServer. Name:[%s], Address:[%s], Port:[%d]\n", __FUNCTION__, __LINE__, name, address, port);

    Network *network = SUPER_PTR(t, Network);

    network->setName(network, name);
    network->setAddress(network, address);
    network->setPort(network, port);
}

CTOR(TCPServer)
SUPER_CTOR(Network);
FUNCTION_SETTING(Init, TCPServer_Init);
END_CTOR

int main()
{
    Network *network = NULL;
    TCPServer *tcp_server = TCPServer_new();
    char recv_data[64] = {0};

    tcp_server->Init(tcp_server, "TCPServer", "192.168.101", 10000);
    network = SUPER_PTR(tcp_server, Network);
    network->RecvSync(network, recv_data);
    network->RecvAsync(network, recv_data);

    lw_oopc_delete(tcp_server);

    return 0;
}
